package include2;
// 徒弟
public class Apprentice {
	private String name;
	private String weapon;
	public Apprentice() {
		super();
	}
	public Apprentice(String name, String weapon) {
		super();
		this.name = name;
		this.weapon = weapon;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getWeapon() {
		return weapon;
	}
	public void setWeapon(String weapon) {
		this.weapon = weapon;
	}
	
	// 徒弟打妖怪
	public void beatMonster(Monster monster) {
		switch (this.name) {
		case "孙悟空" :  
			if (monster.getName().equals("白骨精")) {
				for (int i = 0 ; i < 3; i++) {
					System.out.println(this.name + "使用" + this.weapon +"去打" + monster.getName()); 
				}
			}else {
				System.out.println(this.name + "使用" + this.weapon +"去打" + monster.getName()); 
			}
			System.out.println("救出了师父");
			break;
		case "八戒" : 
			System.out.println(this.name + "使用" + this.weapon +"打"+ monster.getName()+",没打过被抓"); break;
		case "沙和尚" :  
			System.out.println(this.name + "使用" + this.weapon + "去打" + monster.getName() + ",没打过去找大师兄"); break;
		}
	}
}
